﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	xmlns:local="clr-namespace:CountdownCalendar"
	xmlns:CountdownCalendar_Converters="clr-namespace:CountdownCalendar.Converters"
	xmlns:Custom="http://schemas.sheva.com/winfx/2006/xaml/presentation"
	x:Class="CountdownCalendar.Magnet"
	x:Name="UserControl">

	<UserControl.Resources>
		<CountdownCalendar_Converters:DaysWeeksConverter x:Key="DaysWeeksConverter"/>
		<CountdownCalendar_Converters:TimeLeftConverter x:Key="TimeLeftConverter"/>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid Width="Auto" Height="Auto">
							<Grid.RowDefinitions>
								<RowDefinition Height="0.499*"/>
								<RowDefinition Height="0.501*"/>
							</Grid.RowDefinitions>
							<Rectangle Stroke="#FFFFFFFF" Width="Auto" Height="Auto" RadiusY="7.3" RadiusX="7.3" Grid.RowSpan="2">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FFBFBFBF" Offset="0"/>
										<GradientStop Color="#FF828282" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<ContentPresenter Margin="10,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.RowSpan="2"/>
							<Border BorderBrush="{x:Null}" BorderThickness="0,0,0,0" Grid.RowSpan="1" CornerRadius="8,8,0,0">
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#97FFFFFF" Offset="0"/>
										<GradientStop Color="#33FFFFFF" Offset="1"/>
									</LinearGradientBrush>
								</Border.Background>
							</Border>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ObjectDataProvider x:Key="SettingsInstance"/>
    
  </UserControl.Resources>

	<Grid x:Name="_root" DataContext="{Binding Mode=OneWay, Source={StaticResource SettingsInstance}}">
  <!--<Grid x:Name="_root">
  	<Grid.DataContext>
  		<local:Settings/>
  	</Grid.DataContext>-->
		<Grid x:Name="_back" d:IsHidden="True" Visibility="Hidden">
			<Image x:Name="_back_cleanbg" Width="200" Height="300" Source="Images\cdback-clean.png" Stretch="Fill"/>
			<StackPanel HorizontalAlignment="Left" Margin="30,64.999,0,0" VerticalAlignment="Top" Width="130.553" Height="50.459" Orientation="Vertical">
				<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Calibri" Text="Event Date :" TextWrapping="Wrap"/>
				<TextBox x:Name="_eventDateTbx" HorizontalAlignment="Left" Width="130" Text="{Binding Path=EventDate, Mode=TwoWay}" TextWrapping="Wrap" d:LayoutOverrides="Height">
        			<TextBox.Effect>
						<DropShadowEffect Opacity="0.595" BlurRadius="6" ShadowDepth="3"/>
					</TextBox.Effect>
				</TextBox>
				<TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" Text="(mm/dd/yyyy)" TextWrapping="Wrap" FontFamily="Calibri" FontSize="10" FontWeight="Normal"/>
			</StackPanel>
			<StackPanel Margin="30,124.999,0,124.542" Width="130.553" Orientation="Vertical" HorizontalAlignment="Left">
				<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Calibri" Text="Event Name :" TextWrapping="Wrap"/>
				<TextBox x:Name="_eventNameTbx" HorizontalAlignment="Left" Width="130" Text="{Binding Path=EventName, Mode=Default}" TextWrapping="Wrap" d:LayoutOverrides="Height">
        			<TextBox.Effect>
						<DropShadowEffect BlurRadius="6" ShadowDepth="3" Opacity="0.595"/>
					</TextBox.Effect>
				</TextBox>
			</StackPanel>
			<CheckBox Margin="32,0,39.447,84" VerticalAlignment="Bottom" Height="26" Content="Count only week days" IsChecked="{Binding Path=WeekDaysOnly, Mode=Default}"/>
      
			<Button x:Name="_doneBt" HorizontalAlignment="Right" Margin="0,0,39,53" Style="{DynamicResource ButtonStyle1}" VerticalAlignment="Bottom" Content="Done" Foreground="#FFFFFFFF" FontFamily="Calibri" Width="61" Height="16" Padding="1,0,1,0" Cursor="Hand">
				<Button.Effect>
					<DropShadowEffect BlurRadius="6" Color="#77000000" ShadowDepth="3" Opacity="0.6"/>
				</Button.Effect>
			</Button>
		</Grid>
		<Grid x:Name="_front">
			<Image x:Name="_cleanBg" Width="200" Height="300" Source="Images\cdfront-clean.png" Stretch="Fill"/>
			<TextBlock x:Name="_amountLeftLbl" HorizontalAlignment="Center" Margin="0,66,0,0" VerticalAlignment="Top" FontFamily="Hobo Std" FontSize="72" Foreground="#FF0006FF" Text="{Binding Path=EventDate, Converter={StaticResource TimeLeftConverter}, ConverterParameter={StaticResource SettingsInstance}, Mode=Default}" TextWrapping="Wrap" d:LayoutOverrides="Width"/>
			<TextBlock x:Name="_unitLeftLbl" HorizontalAlignment="Center" Margin="0,0,0,121.086" VerticalAlignment="Bottom" FontFamily="Impact" FontSize="18" FontWeight="Normal" Text="{Binding Path=EventDate, Converter={StaticResource DaysWeeksConverter}, ConverterParameter={StaticResource SettingsInstance}, Mode=Default}" TextWrapping="Wrap"/>
			<TextBlock x:Name="_eventLbl" HorizontalAlignment="Center" Margin="0,123,0,0" VerticalAlignment="Center" Width="120" Height="52" FontFamily="Hobo Std" FontSize="18" FontWeight="Bold" Foreground="#FF0006FF" Padding="0,0,0,0" Text="{Binding Path=EventName, Mode=Default}" TextAlignment="Center" TextWrapping="Wrap"/>
			<Custom:ConfigButton x:Name="_configBt" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,48,32.21,0" TextColor="#FF0006FF" EllipseColor="#00A5A5A5" FontFamily="Monotype Corsiva" Cursor="Hand"/>
		</Grid>
	</Grid>
</UserControl>